
#include <stddef.h>

void dgemm_c(size_t n, double *A, double *B, double *C)
{
	for (size_t i = 0; i < n; ++i) {
		for (size_t j = 0; j < n; ++j) {
			double cij = C[i * n + j];
			for (size_t k = 0; k < n; k++) {
				cij += A[i * n + k] * B[k * n + j];
			}
			C[i * n + j] = cij;
		}
	}
}


void dgemm_c_row(size_t n, double *A, double *B, double *C)
{
	for (size_t i = 0; i < n; ++i) {
		for (size_t k = 0; k < n; ++k) {
			for (size_t j = 0; j < n; ++j) {
				C[i * n + j] += A[i * n + k] * B[k * n + j];
			}
		}
	}
}
